package com.szzg10.webservice.chapter5;

import java.util.Map;

import javax.xml.ws.BindingProvider;

import com.szzg10.webservice.chapter5.wsimport.tempConvertAuth.TempConvertAuthImpl;
import com.szzg10.webservice.chapter5.wsimport.tempConvertAuth.TempConvertAuthImplService;

public class TempConvertAuthClient {

	public static void main(String[] args) {
		TempConvertAuthImplService service = new TempConvertAuthImplService();
		TempConvertAuthImpl port = service.getTempConvertAuthImplPort();
		
		BindingProvider provider = (BindingProvider)port;
		Map<String, Object> requestContext = provider.getRequestContext();
		
		requestContext.put(BindingProvider.USERNAME_PROPERTY, "fred");
		requestContext.put(BindingProvider.PASSWORD_PROPERTY, "rockbed");
		
		System.out.println("f2c(-40.1) ==> " + port.f2C(-40.1f));
		System.out.println("c2f(-40.1) ==> " + port.c2F(-40.1f));
		System.out.println("f2c(+98.7) ==> " + port.f2C(+98.7f));
	}
}
